home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2572 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  918 b 

  1. Path: news.unicomp.net!usenet
  2. From: jgore@conline.com (Jerry_Gore)
  3. Newsgroups: comp.lang.c
  4. Subject: *Pointer to Functions();   /* HELP */
  5. Date: 22 Jan 1996 11:18:32 GMT
  6. Organization: Connect! On-Line
  7. Message-ID: <4dvrq8$c2c@news.unicomp.net>
  8. NNTP-Posting-Host: 204.96.7.103
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.2
  11.  
  12. How do I pass a pointer to a funtion?
  13. The following is found in a program:
  14.  
  15.     #define WORD    unsigned int       
  16.     void    InstallTimer0(WORD period,void far (*func)(void));
  17.  
  18. My function is thus:
  19.  
  20.     void far animate(void)    /* I added 'far' for no good reason.   */
  21.     {                         /* It uses that name in InstallTimer0. */ 
  22.     /* do what ever */        
  23.     return;
  24.     }
  25.  
  26. How do I send InstallTimer0 the pointer to my function animate ???
  27. I tried:
  28.  
  29.      InstallTimer0(120 , (*animate)());
  30.  
  31. But of course, this does not work and neither did anything else!
  32. What do I do ???
  33.  
  34.